package com.example.backstage.dao;

import com.example.gok_mall.entity.Product;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
public interface ProductDao {
    int deleteByPrimaryKey(Integer id);

    int insert(Product record);

    int insertSelective(Product record);

    Product selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(Product record);

    int updateByPrimaryKey(Product record);

    //查询商品列表
    List<Product> selectList();

    //商品的模糊查询
    List<Product> selectByNameAndProductId(@Param("productName") String productName, @Param("productId") Integer productId);

    //根据传过来的商品Id，然后将商品添加到购物车中
    List<Product> selectByNameAndCategoryIds(@Param("productName")String productName,@Param("categoryList")List<Integer> categoryList);
}
